home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / calc.1 < prev    next >
Text File  |  1995-07-25  |  10KB  |  331 lines

  1.  
  2.  
  3.  
  4.      ccccaaaallllcccc((((1111))))                  11115555nnnnoooovvvv99993333 ((((^^^^........^^^^))))                   ccccaaaallllcccc((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           calc - arbitrary precision calculator
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           calc [ -h ] [ -q ] [ _c_a_l_c__c_m_d ...  ]
  13.  
  14.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.  
  16.           CALC COMMAND LINE
  17.  
  18.            -h  Print a help message.  This option implies  -q.  This
  19.                is equivalent to the calc command help help.
  20.  
  21.            -q  Disable the use of the $CALCRC startup library scripts.
  22.  
  23.           Without calc_cmds, calc operates interactively.  If one or
  24.           more calc_cmds are given on the command line, calc will
  25.           execute them and exit.
  26.  
  27.           Normally on startup, calc attempts to execute a collection
  28.           of library scripts.  The environment variable $CALCRC (if
  29.           non-existent then a compiled in value) contains a :
  30.           separated list of startup library scripts.  No error
  31.           conditions are produced if these startup library scripts are
  32.           not found.
  33.  
  34.           Filenames are subject to ``~'' expansion (see below).  The
  35.           environment variable $CALCPATH (if non-existent then a
  36.           compiled in value) contains a : separated list of search
  37.           directories.  If a file does not begin with /, ~ or ./, then
  38.           it is searched for under each directory listed in the
  39.           $CALCPATH.  It is an error if no such readable file is
  40.           found.
  41.  
  42.           For more information use the following calc commands:
  43.  
  44.                help usage
  45.                help help
  46.                help environment
  47.  
  48.           OVERVIEW
  49.  
  50.           Calc is arbitrary precision arithmetic system that uses a
  51.           C-like language.  Calc is useful as a calculator, an
  52.           algorithm prototyped and as a mathematical research tool.
  53.           More importantly, calc provides one with a machine
  54.           independent means of computation.
  55.  
  56.           Calc comes with a rich set of builtin mathematical and
  57.           programmatic functions.
  58.  
  59.           Calc is distributed with library of scripts.  Written in the
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/11/94)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      ccccaaaallllcccc((((1111))))                  11115555nnnnoooovvvv99993333 ((((^^^^........^^^^))))                   ccccaaaallllcccc((((1111))))
  71.  
  72.  
  73.  
  74.           same C-like language, library scripts may be read in and
  75.           executed during a calc session.  These library scripts are
  76.           also provided because they are useful and to serve as
  77.           examples of the calc language.  One may further extend calc
  78.           thru the use of user defined scripts.
  79.  
  80.           Internally calc represents numeric values as fractions
  81.           reduced to their lowest terms.  The numerators and
  82.           denominators of these factions may grow to arbitrarily large
  83.           values.  Numeric values read in are automatically converted
  84.           into rationals.  The user need not be aware of this internal
  85.           representation.
  86.  
  87.           For more information use the following calc commands:
  88.  
  89.                help intro
  90.                help builtin
  91.                help stdlib
  92.                help define
  93.                show builtins
  94.                show functions
  95.  
  96.           DATA TYPES
  97.  
  98.           Fundamental builtin data types include integers, real
  99.           numbers, rational numbers, complex numbers and strings.
  100.  
  101.           By use of an object, one may define an arbitrarily complex
  102.           data types.  One may define how such objects behave a wide
  103.           range of operations such as addition, subtraction,
  104.           multiplication, division, negation, squaring, modulus,
  105.           rounding, exponentiation, equality, comparison, printing and
  106.           so on.
  107.  
  108.           For more information use the following calc commands:
  109.  
  110.                help types
  111.                help obj
  112.                show objfuncs
  113.  
  114.           VARIABLES
  115.  
  116.           Variables in calc are typeless.  In other words, the
  117.           fundamental type of a variable is determined by its content.
  118.           Before a variable is assigned a value it has the value of
  119.           zero.
  120.  
  121.           The scope of a variable may be global, local to a file, or
  122.           local to a procedure.  Values may be grouped together in a
  123.           matrix, or into a a list that permits stack and queue style
  124.           operations.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/11/94)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      ccccaaaallllcccc((((1111))))                  11115555nnnnoooovvvv99993333 ((((^^^^........^^^^))))                   ccccaaaallllcccc((((1111))))
  137.  
  138.  
  139.  
  140.           For more information use the following calc commands:
  141.  
  142.                help variable
  143.                help mat
  144.                help list
  145.                show globals
  146.  
  147.           INPUT/OUTPUT
  148.  
  149.           A leading ``0x'' implies a hexadecimal value, a leading
  150.           ``0b'' implies a binary value, and a ``0'' followed by a
  151.           digit implies an octal value.  Complex numbers are indicated
  152.           by a trailing ``i'' such as in ``3+4i''.  Strings may be
  153.           delimited by either a pair of single or double quotes.  By
  154.           default, calc prints values as if they were floating point
  155.           numbers.  One may change the default to print values in a
  156.           number of modes including fractions, integers and
  157.           exponentials.
  158.  
  159.           A number of stdio-like file I/O operations are provided.
  160.           One may open, read, write, seek and close files.  Filenames
  161.           are subject to ``~'' expansion to home directories in a way
  162.           similar to that of the Korn or C-Shell.
  163.  
  164.           For example:
  165.  
  166.                ~/.calcrc
  167.                ~chongo/lib/fft_multiply.cal
  168.  
  169.           For more information use the following calc command:
  170.  
  171.                help file
  172.  
  173.           CALC LANGUAGE
  174.  
  175.           The calc language is a C-like language.  The language
  176.           includes commands such as variable declarations,
  177.           expressions, tests, labels, loops, file operations, function
  178.           calls.  These commands are very similar to their
  179.           counterparts in C.
  180.  
  181.           The language also include a number of commands particular to
  182.           calc itself.  These include commands such as function
  183.           definition, help, reading in library scripts, dump files to
  184.           a file, error notification, configuration control and
  185.           status.
  186.  
  187.           For more information use the following calc command:
  188.  
  189.                help command
  190.                help statement
  191.                help expression
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 7/11/94)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      ccccaaaallllcccc((((1111))))                  11115555nnnnoooovvvv99993333 ((((^^^^........^^^^))))                   ccccaaaallllcccc((((1111))))
  203.  
  204.  
  205.  
  206.                help operator
  207.                help config
  208.  
  209.      FFFFIIIILLLLEEEESSSS
  210.  
  211.           /usr/skunk/lib/calc/*.cal
  212.                               library scripts shipped with calc
  213.  
  214.           /usr/skunk/lib/calc/help/*
  215.                               help files
  216.  
  217.           /usr/skunk/lib/calc/bindings
  218.                               command line editor bindings
  219.  
  220.      EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  221.  
  222.           CALCPATH
  223.                A :-separated list of directories used to search for
  224.                scripts filenames that do not begin with /, ./ or ~.
  225.  
  226.                Default value: .:./lib:~/lib:/usr/skunk/lib/calc
  227.  
  228.           CALCRC
  229.                On startup (unless -h or -q was given on the command
  230.                line), calc searches for files along this :-separated
  231.                environment variable.
  232.  
  233.                Default value: /usr/skunk/lib/calc/startup:~/.calcrc
  234.  
  235.           CALCBINDINGS
  236.                On startup (unless -h or -q was given on the command
  237.                line), calc reads key bindings from the filename
  238.                specified by this environment variable.
  239.  
  240.                Default value: /usr/skunk/lib/calc/bindings
  241.  
  242.      CCCCRRRREEEEDDDDIIIITTTT
  243.  
  244.           Written by David I. Bell.
  245.  
  246.           Thanks for suggestions and encouragement from Peter Miller,
  247.           Neil Justusson, and Landon Noll.
  248.  
  249.           Portions of this program are derived from an earlier set of
  250.           public domain arbitrarily precision routines which was
  251.           posted to the net around 1984.  By now, there is almost no
  252.           recognizable code left from that original source.
  253.  
  254.           Most of this source and binary is:
  255.  
  256.                Copyright (c) 1993 David I. Bell
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 7/11/94)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      ccccaaaallllcccc((((1111))))                  11115555nnnnoooovvvv99993333 ((((^^^^........^^^^))))                   ccccaaaallllcccc((((1111))))
  269.  
  270.  
  271.  
  272.           Some files are a copyrighted David I. Bell and Landon Noll.
  273.  
  274.           Permission is granted to use, distribute, or modify this
  275.           source, provided that this copyright notice remains intact.
  276.  
  277.           Send calc comments, suggestions, bug fixes, enhancements and
  278.           interesting calc scripts that you would like you see
  279.           included in future distributions to:
  280.  
  281.                dbell@canb.auug.org.au chongo@toad.com
  282.  
  283.           Enjoy!
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 7/11/94)
  328.  
  329.  
  330.  
  331.